<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
	//1.数组转对象 {0:a,1:b..}
		var arr=["a","b","c","d"]  //输出 {0:a,1:b..}
		
	//2.字符串转对象
	//思路：先截取,在分割成数组,在拼成对象
	var str='?a=1&b=2&c=3';	//要的json :{a:1,b:2,c:3}	
	
	
   //3.封装一下 
	function hash2json(hash){
		
	}

	var str1='?tab=1&page=2&msg=3';
	console.log(hash2json(str1)) //{tab: "1", page: "2", msg: "3"}
	
	
	
		</script>
	</body>
</html>
